#include<bits/stdc++.h>
using namespace std;
int main(){
	string str;
	cin >> str;
	
	bool flag = false;
	bool mark = false;
	
	int cnt = 1 , ans = -1;
	int l = -1 , r = -1;
	for( int i = 1 ; i < str.length() ; i++ ){
		if( str[i] - str[i - 1] == 1 || str[i] - str[i - 1] == 0 ){
			flag = true;
			cnt++;
		}
		else{
			if( cnt > ans ){
				mark = true;
				ans = cnt;
				r = i - 1;
			} 
			cnt = 1;
		}
	}
	if( cnt > ans ){
		ans = cnt;
		r = str.length() - 1;
	}
	if( !flag ) cout << str[0];
	else{
		if( !mark ) cout << str;
		else for( int i = r - ans + 1 ; i <= r ; i++ ) cout << str[i];
	}
	return 0;
}
